package designPattern.structure7.Flyweight.chapter23_flyweight.test23_5;


//化合物
public class Compound {
    Element element;    //存放享元对象的引用
    String name;
    int number1, number2;

    Compound(Element element, String name, int number1, int number2) {
        this.element = element;
        this.name = name;
        this.number1 = number1;
        this.number2 = number2;
//        print();
    }

    public void print() {
        System.out.println(name + " : " + element.getElementOne() + number1 + " " + element.getElementTwo() + number2);
    }
}

